from typing import List


class Solution:
    def maxSubarraySumCircular(self, nums: List[int]) -> int:
        n = len(nums)
        # 分类讨论是否取最后一个
        dp1 = [0] * n  #
        dp1[0] = nums[0]
        for i in range(1, n):
            dp1[i] = max(dp1[i - 1] + nums[i], nums[i])


if __name__ == '__main__':
    s = Solution()
    r = s.maxSubarraySumCircular([5, -3, 5])
    print(r)
